Method of extensible business object modeling and generation of system artifacts from the models

ABSTRACT

A method for defining XML-based models of logical type hierarchies, business objects and sub-objects, business object operations, enumerations and reusable structures and field-sets. The method defines an optimal, yet extensible, structure of the object models to simplify the modeling process by capturing the most essential elements of the model and inferring any additional information, such as relationship between objects, during the process of generating code, database scripts or other system artifacts from the model. Methods of generating a relational model and a presentation data model from such a business object model.

TECHNICAL FIELD

The invention relates generally to model-driven computer softwaredevelopment systems and specifically to methods for modeling businessobjects and generating other system artifacts from the models.

BACKGROUND ART

As development teams strive for increased productivity, Model DrivenDevelopment (MDD) has been gaining momentum lately with a promise ofmore clean, consistent and robust system designs, faster development bygenerating most of the plumbing code from the model(s), and bettersystem portability from one platform to another.

Most notably MDD has been formalized by the Object Management Group withtheir Model Driven Architecture® (MDA) approach and there are already anumber of vendors that implement or support MDA. The MDA is mostlyoriented around the Unified Modeling Language (UML) specification.

UML models are typically represented in a graphical format as diagrams,which require vendor-specific editors and may not allow simultaneousediting or they make change control management quite difficult.

While UML can be extensible with a use of such features as stereotypes,it doesn't seem to be flexible enough for defining arbitrary models, andthe learning curve for UML seems to be fairly steep. Additionally, eachvendor has to provide proprietary engines and custom transformationlanguages to perform model transformations.

On the other hand, Model Driven Development based on Extensible MarkupLanguage (XML) can leverage a variety of standard XML technologies suchas Extensible Stylesheet Language Transformations (XSLT), XML SchemaDefinitions (XSD), etc. to allow defining any types of models in an XMLformat. You can view and edit XML models with any text editor and easilycompare, merge or version-control them. You can define a grammar(meta-model) for your models with XSD schemas, which can also be used tovalidate the models and to prompt the allowed tags and attributes inXSD-aware XML editors. You can then use the standard XSLT technology tofurther validate the XML model beyond the limitations of the XSDvalidation and to finally transform the model into other systemartifacts, such as code, database scripts, documentation etc.

In both cases, to maximize the benefits of the code generation, thegeneration process needs to be set up in such a way that the developerswould never have to manually change the generated code, but ratherextend it separately, so that the generated artifacts can be regeneratedat any later point if the model has changed. This will ensure that themodels are always in synch with the actual code.

Some modeling methods already store their models in XML format andprovide some graphical tools for editing them, such as the Entity DataModels (EDM) that consist of conceptual models, storage models and themappings between the two models. However defining such models directlyin XML without using a special graphical tool could be extremely hardfor the users as the XML format the models are using tends to be prettyverbose and is not designed to be created or edited manually by theusers.

SUMMARY OF INVENTION

The present invention provides a solution to the above describedproblems by describing a method for defining XML-based business objectmodels that defines an optimal, yet extensible, structure of the objectmodels to simplify the modeling process by capturing the most essentialelements of the model and inferring any additional information, such asrelationship between objects, during the process of generating code,database scripts or other system artifacts from the model.

Most of the existing object models include explicit definitions ofrelationships between the objects. The subject innovation, by contrast,uses the inherent object structure and the types of the object fields toinfer the relationships between the objects. For example, sub-objectsare considered to automatically have a relationship to their parentobject and the parent object key is implicitly included in thesub-objects.

By imposing certain uniqueness rules on the key object fields, arelationship between two objects can be now inferred from the types ofthe object fields or from the field-sets being referenced.

While other models use a fixed set of primitive types for their objectfields and resort to using external mappings for those types during thecode generation, the subject method allows defining and using anextensible hierarchy of logical types right within the model, whereineach logical type can define its own mappings to other kinds of types,such as database types or programming language types, and also inheritsuch mappings from its base type. This approach significantly simplifiesdefining and maintaining the mappings for the logical types as well asensures consistency between object model fields, so that the fields ofthe same or compatible logical types could be mapped to the samephysical types.

Instead of explicitly defining mappings between the model businessobjects and physical data tables or programmable data objects for thecode generation, the present method uses the object and field names toprovide the mapping implicitly, while also allowing to override it forany particular object or field.

Typically other modeling methods that allow describing object operationsrequire defining a separate Value Object structure, which will be usedfor the operation input or output. While the current method also allowsstandalone reusable structures to be used for operations' input oroutput, it also allows defining the operation structures in-line foreach operation.

The present innovation also describes a method for generation of thepresentation layer data model objects from the structure of the businessobject operations rather than from the business object fields. Thisallows generating a more appropriate presentation data models ascompared to the existing methods.

Other features and benefits that characterize embodiments of the presentinvention will be apparent upon reading the following detaileddescription and review of the associated drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a general structure of thebusiness object model.

FIG. 2 is a block diagram illustrating the structure of logical typesdefined in the model.

FIG. 3 is a block diagram illustrating the structure of enumerationsdefined in the model.

FIG. 4 is a block diagram illustrating the structure of field-setsdefined in the model.

FIG. 5 is a block diagram illustrating a reusable structure of a set ofparameters that is used by definitions of both standalone structures andinput or output structures of business object operations.

FIG. 6 is a block diagram illustrating a general structure of businessobjects defined in the model.

FIG. 7 is a block diagram illustrating the structure of business objectfields.

FIG. 8 is a block diagram illustrating the structure of business objectoperations.

FIG. 9 is a block diagram illustrating a method of deriving businessobject relationships from the types of their fields.

FIG. 10 is a block diagram illustrating a method of generatingpresentation objects from the structures of business object operations.

DESCRIPTION OF EMBODIMENTS

While using XML format for business object models described herein couldbe advantageous due to the wide industry support and abundance of vendortools and technologies, workers skilled in the art will recognize thatany other textual format could be used instead to implement the presentmethod and that other changes may be made in form and detail withoutdeparting from the spirit and scope of the invention.

FIG. 1 illustrates a general structure of the business object model thatconsist of logical modules that group a plurality of definitions ofvarious entities such as logical types 100, reusable named sets offields, hereinafter referred to as field-sets 101, enumerations ofpossible values for certain logical types 102, reusable named structures103 that can be used in the object operations or other structures andthe definition of the actual business objects 104 including theirsub-objects.

Logical Type Hierarchies

The present method allows defining a plurality of logical typehierarchies right in the model. The declared types are then used inother model elements, such as object fields or parameters. Any type mayextend another type and inherit its properties and additionalconfiguration, such as a mapping to a corresponding physical type, e.g.SQL type, which can be overridden in the derived type. If certainconfiguration is not specified in the derived type, the one from thebase type will typically be used.

FIG. 2 illustrates the structure of logical types defined in the model.Each type has a unique name 110 that allows referencing this type fromwithin the model. The optional base attribute 111 refers to the basetype that the current type is derived from. This attribute is omittedfor the root type of each hierarchy. The types may also have a sizeattribute 112 that defines its maximum length for string-based types. Alogical type may also be associated with an existing enumeration 114 toindicate the list of possible values whenever such list can bestatically defined. Finally, each logical type provides an extensionpoint 113 where you can specify the mappings to different physical typesor associations with other entities such as UI controls.

Generally, a type hierarchy is built on top of a set of base frameworktypes, which defines most of the mappings to the physical types. Thederived types will then typically specialize the base types according tothe business domain structure. Using the same logical types in the modelhelps to ensure consistency between different system's elements bothvertically and horizontally. For example, if you define a user name tobe of a certain length then all generated database columns that containa user name will have consistent lengths and appropriate validations torestrict the length could be added to the corresponding editing UIcontrols or business layer fields. By the same token, any Boolean fieldcan be consistently represented by the same SQL type (e.g. bit) or a UIcontrol (e.g. checkbox).

Enumerations

Enumerations are used to describe a static set of possible values thatcan be later associated with any logical type. In addition to listingthe items that constitute the enumeration, the present method allowsdefining any number of additional properties that such items may haveand further specifying these properties for each item in theenumeration. This allows building rich object models for very complexsoftware systems.

FIG. 3 illustrates the structure of enumerations defined in the model.Each enumeration has a unique name 120 that allows referencing it fromwithin the model. The definitions of additional item properties 121include the property name, an optional default value and whether or notitems may have multiple values for the property. Each item 122 in theenumeration may have a unique name that identifies the item, the itemactual value and an optional list of additional property values 123.

Field-Sets

Field-sets define named groups of fields in the model that can be usedfor one or multiple object definitions. On one hand, field-sets providea mechanism for declaring composite object keys, which can be referencedby other objects thus establishing a foreign key relationship. On theother hand, they enable support for reusability where the same set offields is used by many objects. This comes in handy in aspect-orienteddesigns. If, for instance, most or all of your objects are supposed tohave a modification stamp, which can include a timestamp and the user ofobject's creation and the last update, then you will be able to declarea field-set with these four fields and then just reference it in everyobject.

FIG. 4 illustrates the structure of field-sets defined in the model.Each field-set has a unique name 130 that allows referencing it fromwithin the model and one or more named fields 131 that reference alogical type defined in the model.

Structures

Structures represent a nested set of simple typed parameters or othercomplex structures and are used to describe business object operations.The structures can be defined either as stand-alone reusable namedentities that can be referenced from within the model or in-line as partof the containing structure or a business object operation.

FIG. 5 illustrates the key components of such a structure. Each simpleparameter 140 has a name 141 and a logical type 142 as well as a flagindicating if it assumes a scalar value or a list of values 143.Similarly, a structure may contain other nested structures 144, whichalso has a unique local name 145 within the containing structure, a flagindicating if this is a list 147, and either a reference to an existingstructure 146 or the definition of the structure in-line. In addition,the structures have an extension point 148 where additionalconfiguration may be provided, such as the presentation data objectsthat this structure should be a part of.

Business Objects

At the core of the model is the definition of business objects asdepicted on FIG. 6, which consists of the object name 150 followed by alist of fields 151 that can be declared as a mix of individual fields orreferences to reusable field-sets that are declared separately in themodel. Each business object may define a set of operations 152 that itsupports, such as create, read, update and delete (CRUD) etc., and hasan extension point 153 where additional configuration may be specified,such as mappings to physical tables or attributes of the service that isgenerated from the object operations.

In addition to the list of fields and operations an object may consistof a number of sub-objects 154 (also referred to as child objects),whose definitions are nested inside the definition of their parentobject. Unless the child object's key is serial and hence unique, theparent's key is automatically included into the child's key. There isalso an implicit foreign key relationship between the child and theparent objects.

FIG. 7 illustrates the structure of object fields comprised of a mix ofregular fields 160 and reusable field-sets 164. Both fields andfield-sets have unique names 161 and 165 within the object. Each fieldhas a type attribute 162 and each field-set has a reference 166 to acorresponding field-set defined in the model. Each field also providesan extension point 168 where additional field-specific configuration maybe specified, such as mappings to database columns, etc.

One of the fields is typically marked as a key 163 with a specifierwhether this is a serial auto-generated key, a user-supplied key or areference to another object's key. Unless it's a reference to anotherkey, the key field should use a dedicated type that no other object usesfor its key type. This way whenever any other field is using this typeor any type derived from it, it will be automatically considered asreferencing this object and a foreign key will be generated unlessspecifically overridden by the field configuration. Composite keys aredefined in a similar way where a field-set reference on the object ismarked as a key 167.

FIG. 8 illustrates the structure of business object operations. Eachoperation has a name 170 and definitions of its input 171 and output 174structures where applicable. The input/output structures can be definedin-line with a nested set of parameters (as in FIG. 5) or just referenceany existing standalone structure 172 and 175. They also support a listflag 173 and 176 indicating if the structure represents a list ofvalues. With business object operations defined like this it is possibleto generate a whole service layer of arbitrary complexity formulti-tiered applications, where the service layer may actually betailored to the client interfaces and not be tied to the underlyingbusiness object model. Each operation also provides an extension point177 where any additional operation-specific attributes may be specified,such as transactional, security, serialization or error handlingproperties.

FIG. 9 illustrates a method of deriving business object relationshipsfrom the types of their fields. The key field id 202 of a Customerobject is using a dedicated type customer id 200, which no other objectcan use for its key. This way, whenever any other object, such as Order,has a field with a type customer id 201, this will automaticallyestablish a reference to the Customer object 203 without having tospecify it explicitly.

FIG. 10 illustrates a method of generating presentation objects from thestructures of business object operations. At the core of the method liesan idea that in multi-tiered systems where the presentation layercommunicates with the business object layer through a service layer, thelatter is much more suitable for generation of the presentation layerthan the actual business object layer. If you think about it, the datafor the user interface data model needs to be read from a service orwill be sent to a service for updates and therefore is based on thestructure of the service operations. At the same time, the serviceoperation parameters may not necessarily have corresponding fields inthe domain model or may span across multiple business objects, where theservice implementation translates operation parameters to and frombusiness object fields. For example, a read operation for an orderobject 300 may return a customer name 302, which is not a field of theorder and is taken from the associated customer object. Similarly,update operation may supply a unique product name 304, which the serviceinternally will resolve into internal product ID to be stored on theorder.

For any set of parameters in operation structures, the present methodallows specifying which presentation objects these parameters should bepart of. In the current example the structures of the read and updateoperations are declared to be part of the presentation objectOrderObject 301 in their additional configurations 303 and 305.Parameters with the same names from both operations are translated intoa single property on the presentation object as long as their types arethe same.

CITATION LIST Patent Literature

7,363,578 B2 June 2004 Bendsen et al. 2006/0130011 A1 October 2004Cornell et al. 2006/0064667 A1 September 2004 Freitas 2007/0266041 A1August 2006 Beckman et al.

Non Patent Literature

-   Xomega Technology, 2010, http://www.xomega.net-   Model-driven architecture, Wikipedia, June 2010,    http://en.wikipedia.org/wiki/Model-driven_architecture-   “ADO.NET Tech Preview: Entity Data Model”, Microsoft Corporation,    June 2006,    http://msdn.microsoft.com/en-us/library/aa697428(VS.80).aspx

1. A method of defining business object models comprising definingplurality of named logical types, field-sets, business objects,structures and enumerations that are referenced in the model by theirnames, wherein defining the business objects further comprises listingthe plurality of their fields, each field having a type attributereferencing a logical type defined in the model, field-sets, eachfield-set referencing a corresponding field-set defined in the model,and the plurality of business object operations and sub-objects.
 2. Themethod of claim 1, wherein defining each logical type further comprisesspecifying extensible mappings to a plurality of other platform-specifictypes or entities associated with the logical type including, but notlimited to, database column types, programming language types, userinterface control types and logical types for other kinds of models. 3.The method of claim 1, wherein defining logical types further comprisesspecifying a base type referencing another logical type defined in themodel where applicable, wherein any configurations or mappings that arenot specified in the current logical type, are considered as inheritedfrom its base type or any of the base types thereof.
 4. The method ofclaim 1, wherein defining logical types further comprises specifying areference to an existing enumeration defined in the model, whereapplicable.
 5. The method of claim 1, wherein defining field-setsfurther comprises listing the plurality of their fields, each fieldhaving a type attribute referencing a logical type defined in the model.6. The method of claim 1, wherein defining structures further compriseslisting the plurality of: parameters, each parameter having a typeattribute referencing a logical type defined in the model, and a flagspecifying if it is a scalar value or a list values; containedstructures, wherein each contained structure either references acorresponding structure defined in the model or is defined in-line; andany additional extensible configuration including, but not limited to,references to presentation objects that this structure is a part of. 7.The method of claim 1, wherein defining each field of a business objector a field-set further comprises specifying additional extensibleconfiguration for the field including, but not limited to, a mapping toa corresponding database column and the foreign key behavior whereapplicable.
 8. The method of claim 1, wherein defining enumerationsfurther comprises defining additional properties that each enumerationitem may have; listing the enumeration items; and specifying theproperty values for the items, each property being one of the propertiesdefined for the current enumeration.
 9. The method of claim 1, whereindefining business objects and sub-objects further comprises marking asingle field or field-set with a key attribute, which indicates if thekey is serial (for fields only), user-supplied or a reference to anotherobject's key.
 10. The method of claim 9, wherein no two objects can bothhave the key fields marked as serial or user-supplied with the samelogical types or key field-sets marked as user-supplied referencing thesame field-set defined in the model.
 11. The method of claim 1, whereindefining operations for business objects and sub-objects furthercomprises defining their input and output structures where applicable,which comprises listing the plurality of: parameters, each parameterhaving a type attribute referencing a logical type defined in the model,and a flag specifying if it is a scalar value or a list values;contained structures, wherein each contained structure either referencesa corresponding structure defined in the model or is defined in-line;and any additional extensible configuration including, but not limitedto, references to presentation objects that this structure is a part of.12. The method of claim 1, wherein defining business objects andsub-objects further comprises specifying additional extensibleconfiguration for the objects including, but not limited to, mappings tocorresponding database tables and custom service attributes whereapplicable.
 13. A method of generating a relational model from abusiness object model, the business object model defined as per claim 1,comprising generating a plurality of table definitions and foreign keyconstraints between the said tables.
 14. The method of claim 13, whereingenerating the plurality of table definitions further comprisesgenerating the primary keys for said tables, wherein the primary keysare based on the corresponding object fields or field-sets that aremarked with a key attribute and also include the primary key of theparent object if the table is based on a sub-object that has anon-serial key.
 15. The method of claim 13, wherein generating theplurality of foreign key constraints further comprises using a fieldtype to find an object with a key field of the same type or any of basetypes thereof, that object providing the referenced table definition forthe foreign key constraint.
 16. The method of claim 13, whereingenerating the plurality of foreign key constraints further comprisesusing objects' contained field-sets to find an object with a keyfield-set referencing the same field-set defined in the business objectmodel, that object providing the referenced table definition for theforeign key constraint.
 17. The method of claim 13, wherein generatedtable names are based on additional configuration for the correspondingobject or on the object fully qualified name if no such configuration isprovided and generated column names are based on additionalconfiguration for the corresponding object field or on the field name ifno such configuration is provided.
 18. A method of generating apresentation data model from a business object model, the businessobject model defined as per claim 1, comprising generating a pluralityof presentation objects based on a plurality of structures defined inthe business object model.
 19. The method of claim 18, whereingenerating the plurality of presentation objects further comprisesbuilding a plurality of properties for each presentation object, theplurality of properties based on parameters of the plurality of businessobject model structures that are either part of input/output structuresof business object operations or part of standalone structures definedin the business object model, wherein each of the plurality ofstructures is configured to be a part of the current presentationobject.
 20. The method of claim 19, wherein parameters that have thesame name result in a generation of a single presentation objectproperty as long as their types are the same; otherwise an error isreported.